package it.polimi.swKnights.SWIMv2.ejb.entityBeans;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class User
{
	@Id
	private String userName;

	@Column(nullable = false)
	private String passwordHash;

	@Column(nullable = false)
	private String eMail;

	private Date birthday;

	private String name;

	private String surname;
	
	

	@Embedded
	private Address address;

	private char sex;
	
	/*
	 * Constructors
	 */
	
	public User()
	{
		
	}
	
	public User(String userName, String passwordHash, String eMail)
	{
		this.userName = userName;
		this.passwordHash = passwordHash;
		this.eMail = eMail;
	}

	/*
	 * Getters and setters
	 */


	public String getUserName()
	{
		return userName;
	}

	public void setUserName(String userName)
	{
		this.userName = userName;
	}

	public String getPasswordHash()
	{
		return passwordHash;
	}

	public void setPasswordHash(String passwordHash)
	{
		this.passwordHash = passwordHash;
	}

	public String geteMail()
	{
		return eMail;
	}

	public void seteMail(String eMail)
	{
		this.eMail = eMail;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getSurname()
	{
		return surname;
	}

	public void setSurname(String surname)
	{
		this.surname = surname;
	}

	public char getSex()
	{
		return sex;
	}

	public void setSex(char sex)
	{
		this.sex = sex;
	}

	public Date getBirthday()
	{
		return birthday;
	}

	public void setBirthday(Date birthday)
	{
		this.birthday = birthday;
	}

	public Address getAddress()
	{
		return address;
	}

	public void setAddress(Address address)
	{
		this.address = address;
	}

	
}
